home *** CD-ROM | disk | FTP | other *** search
- Path: castle.nando.net!news
- From: actuary@nando.net (Bill McCarthy)
- Newsgroups: comp.lang.c
- Subject: Re: Checking a file
- Date: 4 Apr 1996 09:18:15 GMT
- Organization: Nando.net Public Access
- Message-ID: <4k044n$fdp@castle.nando.net>
- References: <4jkvgq$i8g@raffles.technet.sg>
- Reply-To: actuary@nando.net (Bill McCarthy)
- NNTP-Posting-Host: grail1519.nando.net
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <4jkvgq$i8g@raffles.technet.sg>,
- leonard@pacific.net.sg (Leonard Sim) writes:
-
- > I am having some trouble trying to code this procedure, can somebody
- >please help me? The requirements of the procedure is as follows :
- >
- >There will be a text file containing records of users attempted logins
- >to a system. The format of the file is like this :
- >
- >USERID DATE TIME REMARKS
- >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- >USER01 19960331 131259 SUCCESSFUL
- >USER01 19960331 131441 SUCCESSFUL
- >USER02 19960331 131834 UNSUCCESSFUL
- >USER01 19960331 132000 SUCCESSFUL
- >
- >This procedure must scan through this file and pick up suspected
- >violation attempts, using a criterion of 3 or more successive
- >unsuccessful logon attempts. The violation attempts must then be
- >output into another data file.
- >
- >I hope somebody can help me??
-
- You could use a structure containing an ID and a counter.
-
- The first time an ID is used, set the counter to 0. If the
- remark is a success, the counter is set to 0, otherwise it
- is incremented.
-
- If the counter == 3, log an error.
-
- Repeat the process until EOF is encountered.
-
- Bill McCarthy
- actuary@nando.net
- Wendell, NC USA
-
-